package com.itheima.d7_interface_demo;

import java.util.ArrayList;

//班级管理类
public class ClassroomManager {
    //集合：存储所有学生信息
    private ArrayList<Student> studentList = new ArrayList<>();

    //创建业务对象（代码使用多态形式）
    StudentOperator studentOperator = new StudentOperatorImpl2();


    public ClassroomManager() {
    }
    public ClassroomManager(ArrayList<Student> studentList) {
        this.studentList = studentList;
    }

    //功能1：打印全班学生信息
    public void printInfo(){
        studentOperator.printAllInfo(studentList);
    }

    //功能2：打印出全班学生平均成绩
    public void printAvg(){
        studentOperator.printAverageScore(studentList);
    }
}
